﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using WebUI.Helper;

namespace WebUI.Con
{
    public class TakeMoneyController : Controller
    {
        public ActionResult index()
        {
            return View();
        }
        public ActionResult TakeMoney()
        {
            if (Request["TakeMoney"] != null && Request["TakeMoney"].ToString() != null)
            {
                Model.TakeMoney tm = new Model.TakeMoney();
                tm.TakeMoneyUserID = OperateContext.Current.Usr.UserID;
                tm.TakeMoneyTime = DateTime.Now;
                tm.TakeMoneySum = Convert.ToDecimal(Request["TakeMoney"]);
                int p = OperateContext.Current.BLLSession.ITakeMoneyBLL.Add(tm);
                if (p == 1)
                {

                    return Content("ok");
                }
                else
                {
                    return Content("Error");
                }
            }

            return Content("Error");
        }
    }
}
